using System;
using System.Collections.Generic;
using System.Text;

namespace RikMigrations
{
	public enum CascadeOptions
	{
		NoAction,
		Cascade,
		SetNull,
		SetDefault
	}

	public class ForeignKey
	{
		public ForeignKey(string name, Table table, string column, string foreignTable, string foreignSchema, string foreignColumn)
		{
			this.Name = name;
			this.Table = table;
			this.Column = column;
			this.ForeignTable = foreignTable;
			this.ForeignSchema = foreignSchema;
			this.ForeignColumn = foreignColumn;
		}

		#region Properties

	    public string Name { get; set; }

	    public Table Table { get; set; }

	    public string Column { get; set; }

	    public string ForeignTable { get; set; }

		public string ForeignSchema { get; set; }

	    public string ForeignColumn { get; set; }

	    public CascadeOptions DeleteCascadeOption { get; set; }

	    public CascadeOptions UpdateCascadeOption { get; set; }

	    #endregion

		public ForeignKey OnDelete(CascadeOptions option)
		{
			DeleteCascadeOption = option;
			return this;
		}

		public ForeignKey OnUpdate(CascadeOptions option)
		{
			UpdateCascadeOption = option;
			return this;
		}
	}
}